import request from "@/utils/request";

export default {
    //登录
    login(phone,password){
        return request({
            url:'/users/login',
            method:'get',
            params:{
                phone:phone,
                password:password
            }
        })
    },
    //发送验证码
    sendMsm(phone){
        return request({
            url:'/util/sendCode',
            method:'get',
            params:{
                phone:phone
            }
        })
    },
    //查询所有未审批店铺
    findAllUnaudited(){
        return request({
            url:'/users/findAllUnapproved',
            method:'get',
            params:{

            }
        })
    },
    //查询所有店铺（含审批未审批）
    findAllStores(){
        return request({
            url:'/users/findAllStores',
            method:'get',
            params:{

            }
        })
    },
    //查询所有审批店铺（后端未做分页）
    findAllAudited(){
        return request({
            url:'/users/findAllStore',
            method:'get',
        })
    },
    //修改店铺审批状态
    updateStoreStateBy(uid,sid){
        return request({
            url:'/users/updateStoreStateBy',
            method:'get',
            params:{
                uid:uid,
                sid:sid
            }
        })
    },
    //查询所有普通用户
    findUsersByAuthority(){
        return request({
            url:'/users/findUsersByAuthority',
            method:'get',
            params:{
                authority:'1'
            }
        })
    },
    addStore(store){
        return request({
            url:'store/addStore',
            method:'post',
            data:store
        })
    },
    //修改个人信息
    updateMyInformation(users){
        return request({
            url:'/users/updateMyInformation',
            method:'post',
            data:users
        })
    },
    //新增收货地址
    addUsersAddress(usersAddress){
        return request({
            url:'users/addUsersAddress',
            method:'post',
            data:usersAddress
        })
    }
}